public class java3{
    public static void main(String[] args) {
        boolean a = true;
        boolean b = false;
        System.out.println("逻辑与&运算");
        System.out.println(a + "&" + a + "=" + (a & a));
        System.out.println(a + "&" + b + "=" + (a & b));
        System.out.println(b + "&" + b + "=" + (b & a));
        System.out.println(b + "&" + b + "=" + (b & b));

        System.out.println("逻辑或 | 运算");
        System.out.println(a + "|" + a + "=" + (a | a));
        System.out.println(a + "|" + b + "=" + (a | b));
        System.out.println(b + "|" + a + "=" + (b | a));
        System.out.println(b + "|" + b + "=" + (b | b));

        System.out.println("逻辑异或 ^ 运算");
        System.out.println(a + "^" + a + "=" + (a ^ a));
        System.out.println(a + "^" + b + "=" + (a ^ b));
        System.out.println(b + "^" + a + "=" + (b ^ a));
        System.out.println(b + "^" + b + "=" + (b ^ b));
}